<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>行内元素</title>
  <style>
    .container {
      margin: 100px;
      padding: 15px;
      border-radius: 12px;
      box-shadow: 0 0 10px 10px #f4f4f4;
    }
    .box, .inline-block, .inline-flex {
      position: relative;
      margin: 0;
      /* height: 42px; */
      font-size: 0;
      outline: 1px solid red;
    }
    .box::after, .inline-block::after, .inline-flex::after {
      position: absolute;
      top: 50%;
      margin-top: -1px;
      left: 0;
      display: block;
      content: '';
      width: 100%;
      height: 2px;
      background: green;
    }
    .box span, .box i {
      font-size: 30px;
    }
    .box i,.line-block i, .inline-flex i {
      font-style: normal;
    }
    .inline-block span, .inline-block i {
      display: inline-block;
      height: 36px;
      line-height: 36px;
      font-size: 30px;
    }
    .inline-flex {
      display: flex;
      /* height: 36px; */
      align-items: center;
      font-size: 30px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="box"><span>行内元素</span></div>
    <div class="inline-block"><span>x</span><i><</i></div>
    <div class="inline-flex"><span>x</span><i><</i></div>
  </div>
</body>
</html>